package org.duang.event.core;

public class EventModel implements java.io.Serializable  {
	
	private static final long serialVersionUID = -6215104676746611824L;
	private Object model;		// 要传递的值
	private String key;				// 对应的Listener类里getKey()的值，用于识别Listener
	private boolean aync = false;		// 同步或异步执行，true时为异步，默认为false, 同步		
	
	public EventModel() {
		
	}

	public long getCurrenttime() {
		return System.currentTimeMillis();
	}

	public Object getModel() {
		return model;
	}

	public void setModel(Object model) {
		this.model = model;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public EventModel(Object model, String key, boolean aync) {
		super();
		this.model = model;
		this.key = key;
		this.aync = aync;
	}

	@Override
	public String toString() {
		return "DuangEventModel [model=" + model + ", key=" + key +  ", aync=" + aync +"   CurrentTime=" + getCurrenttime() + "]";
	}

	public boolean isAync() {
		return aync;
	}

	public void setAync(boolean aync) {
		this.aync = aync;
	}
	
	
}
